package com.gec.web.servlet;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.gec.entity.Buycar;
import com.gec.entity.Member;
import com.gec.service.BuycarService;
import com.gec.service.impl.BuycarServiceImpl;
@WebServlet("/buycars")
public class BuyCarSetvlet extends HttpServlet {

	@Override
	protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		Member me = (Member) req.getSession().getAttribute("member");
		int sid = Integer.parseInt(req.getParameter("shopid"));
		BuycarService servlet = new BuycarServiceImpl();
		List<Buycar> buycar = servlet.showAll(me.getId(),sid);
		req.setAttribute("buycar", buycar);
		req.getRequestDispatcher("/WEB-INF/jsp/buycar.jsp").forward(req, resp);
	}

}
